package com.mhkj.execute.feedback.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.mhkj.execute.feedback.entity.PlanFeedBack;
import com.mics.core.system.base.repository.BaseRepository;

/**
 * 获取月度计划反馈
 * 
 * @author ypx
 * @date 2018年7月2日
 * @version 1.0
 */
@Repository
public interface PlanFeedBackDao extends BaseRepository<PlanFeedBack> {


	/**
	 * 根据任务类型查询
	 * 
	 * @param taskType
	 * @return
	 */
	@Query(value = "SELECT COUNT(*),YEAR (t.actual_end_date),MONTH (t.actual_end_date) FROM t_plan_feed_back t where t.task_type=?1 GROUP BY MONTH (t.actual_end_date)", nativeQuery = true)
	List<Object[]> getCountByFeedBack(String taskType);

	@Query(value="select t.* from t_plan_feed_back t where t.is_complete = 1 ",nativeQuery=true)
	List<PlanFeedBack> listCompelete();

}
